﻿using System;
using System.Windows.Forms;

namespace GUserInterface
{
    public partial class NewFlowDlg : Form
    {
        #region Variables

        string title = "";

        #endregion


        #region Properties

        public string Title
        {
            get { return title; }
        }

        #endregion

        #region Construction

        public NewFlowDlg( string title )
        {
            InitializeComponent();
            this.textBox1.Text = title;
        }

        #endregion

        #region Methods

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Trim() == string.Empty)
            {
                MessageBox.Show("Flow name cannot be empty!", "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            this.title = this.textBox1.Text;
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        #endregion
    }
}
